//package com.qf.stream;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.messaging.Message;
//import org.springframework.messaging.MessageHandler;
//import org.springframework.messaging.MessagingException;
//import org.springframework.messaging.SubscribableChannel;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.PostConstruct;
//
//@Component
//public class suibianxiedelei {
//
//    private Consumer consumer;
//    @Autowired
//    public void setConsumer(Consumer consumer) {
//        this.consumer = consumer;
//    }
////    程序启动之后就执行
//    @PostConstruct
//    public void init(){
////        获取收消息的通道
//        SubscribableChannel subscribableChannel = consumer.subscribaleChannel();
////        通过通道获取消息
//        subscribableChannel.subscribe(new MessageHandler() {
//            @Override
//            public void handleMessage(Message<?> message) throws MessagingException {
//                Object payload = message.getPayload();
//                System.out.println("收到的消息是---》"+payload);
//            }
//        });
//    }
//}
